<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<style type="text/css">
			*{
				margin: 0;
				padding: 0;
			}
			li{
				list-style-type: none;
				text-align: center;
				
			}
			.frist>li{
				display: inline-block;
				position: relative; /*子绝父相*/
				width: 100px;
			}
			li>ul{
				display: none;
				position: absolute; /*脱离文档流*/
				width: 100px;  /*调整宽度  left：18px*/
			}
			.frist>li:hover{
				background-color: red;
				
			}
			.frist>li:hover>ul{
				display: block;
			}
		</style>
	</head>
	<body>
		<ul class="frist">
			<li>一级菜单
				<ul>
					<li>二级菜单</li>
					<li>二级菜单</li>
					<li>二级菜单</li>
					<li>二级菜单</li>
				</ul>
			</li>
			<li>一级菜单
				<ul>
					<li>二级菜单</li>
					<li>二级菜单</li>
					<li>二级菜单</li>
					<li>二级菜单</li>
				</ul>
			</li>
			<li>一级菜单
				<ul>
					<li>二级菜单</li>
					<li>二级菜单</li>
					<li>二级菜单</li>
					<li>二级菜单</li>
				</ul>
			</li>
		</ul>
	</body>
</html>
